<!--
  描述：菜单配置表详情页
  @author guoqiao
  @since 2021-05-28 16:23:56
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title th:text="${(menu.menuId == null) ? '新增':'详情'}"></title>
</head>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">
        <a th:lay-href="|${SYS_MCC}/mcc/menu/list.action|" lay-text="菜单管理" th:text="菜单管理">菜单管理</a>
        &nbsp;&nbsp;>&nbsp;
        <zmn th:text="${(menu.menuId == null) ? '新增' : '修改'+ menu.menuName}"></zmn>
    </blockquote>

    <div class="layui-card">
        <form method="post" action="" class="layui-form" lay-filter="zmn-form">

            <input type="hidden" name="menuId" th:value="${menu.menuId}"/>

            <div class="layui-card-header" style="margin-top:10px;">
                <b>基本信息</b>
            </div>
            <div class="layui-split">&nbsp;</div>

            <div class="layui-form-item" th:if="${menu.menuId > 0}">
                <label class="layui-form-label">菜单ID：</label>
                <div class="layui-input-block">
                    <div class="layui-form-mid">
                        <span th:text="${menu.menuId}">菜单ID</span>
                    </div>
                </div>
            </div>

            <div class="layui-form-item" hidden>
                <label class="layui-form-label">上级菜单Id：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 390px">
                        <input type="text" name="parentId" th:value="${menu.parentId}" placeholder="上级菜单Id"
                                autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item" th:if="${menu.parentId > 1}">
                <label class="layui-form-label">上级菜单：</label>
                <div class="layui-input-block" style="width: 390px">
                    <select id="parentId" name="parentId" lay-search="" lay-verify="required">
                        <option value="">-选择-</option>
                        <option th:value="${parent.menuId}" th:selected="${parent.menuId == menu.parentId}"
                                th:text="${parent.menuName}" th:each="parent:${parentList}">
                        </option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">菜单类型：</label>
                <div class="layui-input-block">
                    <input type="radio" name="menuType" lay-verify="required" lay-filter="select-menu-type"
                           th:disabled="${menu.parentId == 1 || menu.menuId != null }"
                           th:checked="${menuType.key == menu.menuType}"
                           th:each="menuType:${menuTypes}"
                           th:value="${menuType.key}"
                           th:title="${menuType.value}"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"><span style="color: red">*</span>菜单名称：
                </label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 390px">
                        <input type="text" name="menuName" th:value="${menu.menuName}" placeholder="菜单名称"
                               lay-verify="required" autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item" id="sys_id" hidden>
                <label class="layui-form-label"><span style="color: red">*</span>所属系统：
                </label>
                <div class="layui-input-inline" style="width: 390px">
                    <select id="sysId" name="sysId" lay-search="" lay-verify="isRequiredSysId">
                        <option value="">-选择-</option>
                        <option th:value="${sys.sysId}" th:selected="${sys.sysId == menu.sysId}"
                                th:text="${sys.sysName}" th:each="sys:${sysList}">
                        </option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item" id="menu_url"  hidden>
                <label class="layui-form-label"><span style="color: red">*</span>菜单URL：
                </label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 390px">
                        <input type="text" name="menuUrl" th:value="${menu.menuUrl}" placeholder="菜单URL"
                               lay-verify="isRequiredMenuUrl" autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item" id="menu_permit_url" hidden>
                <label class="layui-form-label"><span style="color: red">*</span>菜单权限URL：
                </label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 390px">
                        <input type="text" name="menuPermitUrl" th:value="${menu.menuPermitUrl}"
                               placeholder="菜单权限URL"
                               lay-verify="isRequiredMenuPermitUrl" autocomplete="off" class="layui-input"
                               maxlength="100"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item" id="show_sys_id">
                <label class="layui-form-label">展示系统：</label>
                <div class="layui-input-inline" style="width: 390px">
                    <select id="showSysId" name="showSysId" lay-search="">
                        <option value="">-选择-</option>
                        <option th:value="${sys.sysId}" th:selected="${sys.sysId == menu.showSysId}"
                                th:text="${sys.sysName}" th:each="sys:${sysList}">
                        </option>
                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">菜单icon：
                </label>
                <div class="layui-input-inline">
                    <div class="layui-input-inline" style="width: 390px">
                        <input type="text" name="menuIcon" th:value="${menu.menuIcon}" placeholder="菜单icon"
                               autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
            </div>

            <zmn th:if="${menu.menuId > 0}">
                <div class="layui-card-header">
                    <b>其他信息</b>
                </div>
                <div class="layui-split">&nbsp;</div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">修改人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${menu.updater} + '&nbsp;/&nbsp;' + ${#dates.format(menu.updateTime, 'yyyy-MM-dd HH:mm:ss')}">
                            修改人/时间
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">创建人/时间</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${menu.creater} + '&nbsp;/&nbsp;' + ${#dates.format(menu.createTime, 'yyyy-MM-dd HH:mm:ss')}">
                            创建人/时间
                        </div>
                    </div>
                </div>
            </zmn>

            <div class="layui-form-item submit">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit"
                            th:if="${#authPermit.checkPermit('/mcc/menu/modify/addEdit.action')}">保存
                    </button>
                    <button id="cancel" class="layui-btn layui-btn-primary">
                        取消
                    </button>
                </div>
                <div class="layui-input-block"></div>
            </div>


        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    var json = {
        menu: [[${menu}]]
    };

    layui.config({
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        treeTable2: "treeTable-3.x",
        mcc_menu_detail: "menu/zmn.menu.detail",
    }).use(['index', 'mcc_menu_detail']);

</script>
</body>
</html>